package chapter11.EX27;

import java.util.Queue;

/**
 * Created by Caesar on 2015/12/30.
 */
public class Test {
    static void poll(Queue<Command> queue) {
        Command com = queue.remove();
        com.operation();
    }

    public static void main(String[] args) {
        Leader leader = new Leader();
        leader.setin(new Command("1"));
        leader.setin(new Command("2"));
        poll(leader.queue);
        leader.setin(new Command("3"));
        leader.setin(new Command("4"));
        poll(leader.queue);
        poll(leader.queue);
        poll(leader.queue);
    }
}
